package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 会员信息
 */
@Entity
@Getter
@Setter
@ToString
@ApiModel("会员信息")
@Table(name = "member_info")
@DynamicInsert
@DynamicUpdate
public class MemberInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("会员名称")
    @Column(name = "member_name", nullable = false)
    @NotNull(message = "会员名称不能为空")
    private String memberName;

    @ApiModelProperty("简介")
    @Column(name = "introduction", nullable = true)
    private String introduction;

    @ApiModelProperty("状态 0-禁用 1-启用")
    @Column(name = "status", nullable = false)
    @NotNull(message = "状态不能为空")
    private String status;

    @ApiModelProperty("价格")
    @Column(name = "price", nullable = false)
    @NotNull(message = "价格不能为空")
    private BigDecimal price;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

    @Column(name = "details")
    @ApiModelProperty("详细信息")
    private String details;

}
